Start

Column

Scatter Plot

Interactive Pie Plot

Column

Histogram Plot

Bar Plot

Info Data

Row

Dataset

Row

List of the variable names

Main summary of the data

Age Height Weight Best.overall Growth Value Wage Release.clause
Min. :16.00 Min. :161.0 Min. : 53.00 Min. :49.00 Min. : 0.00 Min. : 0 Min. : 0 Min. : 0
1st Qu.:20.00 1st Qu.:177.0 1st Qu.: 70.00 1st Qu.:70.00 1st Qu.: 0.00 1st Qu.: 2000000 1st Qu.: 5000 1st Qu.: 2300000
Median :23.00 Median :182.0 Median : 75.00 Median :75.00 Median : 5.00 Median : 4900000 Median : 17000 Median : 7700000
Mean :24.18 Mean :181.9 Mean : 75.04 Mean :74.28 Mean : 5.91 Mean : 11143961 Mean : 29843 Mean : 19823574
3rd Qu.:27.00 3rd Qu.:187.0 3rd Qu.: 80.00 3rd Qu.:79.00 3rd Qu.:10.00 3rd Qu.: 14000000 3rd Qu.: 39000 3rd Qu.: 24200000
Max. :44.00 Max. :206.0 Max. :103.00 Max. :93.00 Max. :25.00 Max. :185000000 Max. :350000 Max. :356100000

About me

Panel including these information

Bilgilerim
Name Number Date Dataset_Name
Kamil Göçer 666 2024-06-09 players_3120.csv
---
title: "Analysis On Footballers"
output: 
  flexdashboard::flex_dashboard:
    orientation: columns
    vertical_layout: fill
    source_code: embed
    theme: cerulean
---

```{r setup, include=FALSE}
library(flexdashboard)
library(dplyr)
library(ggplot2)
library(DT)
sonuc <- read.csv("result.csv")
sonuc_ <-distinct(sonuc, cleaned_names, .keep_all = TRUE)
sonuc_
library(dplyr)
yeni <- sonuc_ %>% 
  select(cleaned_names  , Age, cleaned_teams,Height,Weight,foot ,Best.overall,Best.position, Growth,Value,Wage,Release.clause) %>% 
    rename(Names = cleaned_names, Teams = cleaned_teams, Foot = foot)

yeni$age_group  <- cut(yeni$Age, breaks = c(0,18, 25, 30, 40, max(yeni$Age)), labels = c("Under 18", "Young", "Middle-aged", "Old", "Very Old"))

```

# Start

Column {data-width=250 .tabset}
-----------------------------------------------------------------------

### Scatter Plot

```{r}
# bu bir grafik 
ggplot(yeni, aes(x = Best.overall, y = Value)) +
  geom_point(aes(color = Value, size = Value), alpha = 0.5) +  # Noktaları mavi renkte ve boyut 3 yapma
  scale_color_gradient(low = "blue", high = "red", name = "Value")+
  labs(title = "Potential vs Value Scatter Plot", x = "Potential", y = "Value") +  # Başlık ve eksen etiketleri ekleme
  theme_minimal()



```

### Interactive Pie Plot

```{r}
library(plotly)
library(dplyr)
pozisyon_frekans <- table(yeni$Best.position)

# Veri çerçevesi oluşturma
df <- data.frame(
  pozisyon = names(pozisyon_frekans),
  frekans = as.numeric(pozisyon_frekans)
)

# Pasta grafiği oluşturma
plot_ly(
  data = df,
  labels = ~pozisyon,
  values = ~frekans,
  type = "pie"
) %>%
  layout(
    title = "Distribution of Positions Played by Footballers",
    showlegend = TRUE,
    legend = list(title = list(text = 'Positions')),
    marker = list(
      colors = c("#FF3333", "#FF9933", "#FFCC66", "#99FF66", "#66CCCC", "#3399FF", "#9966FF", "#FF66B2", "#FF6699", "#FF3333", "#FF9933", "#FFCC66", "#99FF66", "#66CCCC", "#3399FF", "#9966FF", "#FF66B2")
    )
  )
# Futbolcuların poziyonlarına göre oluşturulan pasta grafiği

```

Column {data-width=250}
-----------------------------------------------------------------------

### Histogram Plot

```{r fig.width = 12, fig.height= 5}
  
ggplot(sonuc, aes(x = Best.overall)) +
  geom_histogram(binwidth = 0.99, fill = "skyblue", color = "black") +
  labs(title = "Distribution Of Overall Ratings Achieved By Footballers", x = "Best Potential", y = "Frequency") +
  theme(
    plot.background = element_rect(fill = "transparent", color = NA),
    panel.background = element_rect(fill = "transparent", color = NA)
  ) +
  theme(
    plot.title = element_text(size = 20),  
    axis.title.x = element_text(size = 16),  
    axis.title.y = element_text(size = 16),  
    axis.text.x = element_text(size = 14),  
    axis.text.y = element_text(size = 14),  
    legend.title = element_text(size = 16), 
    legend.text = element_text(size = 14)  
  )
  
#Distribution Of Overall Ratings Achieved By Footballers
```

### Bar Plot

```{r fig.width = 12, fig.height= 5}
library(plotly)
bar<-ggplot(yeni, aes(x = age_group, fill = age_group)) +
  geom_bar() +
  theme_minimal() +
  labs(title = "Bar Plot of Player Ages by Age Group",
       x = "Age Group",
       y = "Count",
       fill = "Age Group") +
  scale_fill_manual(values = c("#FF6F61", "#6B5B95", "#88B04B", "#F7CAC9", "#92A8D1"))+
   theme(
    plot.title = element_text(size = 20),  
    axis.title.x = element_text(size = 16),  
    axis.title.y = element_text(size = 16),  
    axis.text.x = element_text(size = 14),  
    axis.text.y = element_text(size = 14),  
    legend.title = element_text(size = 16), 
    legend.text = element_text(size = 14)  
  )
bar
```

# Info Data


Row {data-height=450}
-------------------------------------
### Dataset 
```{r}
library(DT)
datatable(yeni, options = list(
  pageLength = 10,
  editable = 'cell'
  
))
```



Row {data-height=350}
-------------------------------------
### List of the variable names
```{r}

#variables <- data.frame("Variable Names" = names(yeni))
#datatable(variables, options = list(dom = 't'))

library(DT)

variables <- data.frame("Variable Names" = names(yeni))

datatable(variables, options = list(dom = 't')) %>%
  formatStyle(columns = names(variables), fontSize = '10px')

```

### Main summary of the data
```{r fig.width = 5, fig.height= 5}
library(kableExtra)
summary_data <- summary(yeni)

de_stat<-yeni %>%
  select(-Names,-Teams,-Foot,-Best.position,-age_group)%>% 
  summary() %>%
  knitr::kable() %>% 
  kable_styling(font_size = 10)
de_stat
#datatable(summary_data)
```

# About me

### Panel including these information
```{r}
library(DT)
library(tibble)

# Verileri oluşturma ve değişken isimlerini İngilizce yapma
veri <- tibble(
  Name = "Kamil Göçer",
  Number = 666,
  Date = as.Date("2024-06-09"),
  Dataset_Name = "players_3120.csv"
)

library(DT)
library(tibble)
library(gt)

# Verileri oluşturma ve değişken isimlerini İngilizce yapma
veri <- tibble(
  Name = "Kamil Göçer",
  Number = 666,
  Date = as.Date("2024-06-09"),
  Dataset_Name = "players_3120.csv"
)

veri %>% 
  gt() %>% 
  tab_header(
    title = "Bilgilerim"
    
  ) 
```